package com.test.singleton.lanhan;

//指令重排
public class Singleton3 {

    private Singleton3(){}
    private volatile static Singleton3 instance= null;

    public Singleton3 getInstance(){
        if(instance == null){
            synchronized (Singleton3.class){
                if(instance == null){
                    instance = new Singleton3();
                }
            }
        }
        return instance;
    }


}
